



    <div class="image-upload-box">
        <label class="layui-form-label">上传图片：</label>





            <li class="icon">
                <div class="img-showbox">
                    <img src="../../uploadfiles/<?echo $theme_folder?>/<? echo $term['icon'] ?>" width="100"/>
                    <a   class="delete-button" href="term-delete-img.php?nid=<?php echo $trans_nid ?>&&img=icon">
                        <i class="layui-icon">&#x1007;</i>
                    </a>
                </div>


                <h6 >ICON图片</h6>
                <br class="clearfloat" />


                <div class="upload-function">
                    <div>
                        <span class="choose-btn layui-btn"/>上传图片</button>
                    </div>
                    <span class="notice">请上传像素<? echo $first_icon_data[0]?>X<? echo $first_icon_data[1]?>的图片,格式为jpeg</span>
                </div>
            </li>






        <li class="icon">
            <div class="img-showbox">
                <img src="../../uploadfiles/<?echo $theme_folder?>/<? echo $term['icon'] ?>" width="100"/>
                <a   class="delete-button" href="term-delete-img.php?nid=<?php echo $trans_nid ?>&&img=icon">
                    <i class="layui-icon">&#x1007;</i>
                </a>
            </div>


            <h6 >ICON图片</h6>
            <br class="clearfloat" />


            <div class="upload-function">
                <div>
                    <span class="choose-btn layui-btn"/>上传图片</button>
                </div>
                <span class="title-data">(请上传像素<? echo $first_icon_data[0]?>X<? echo $first_icon_data[1]?>的图片,格式为jpeg)</span>
            </div>
        </li>


        <li class="icon">
            <div class="img-showbox">
                <img src="../../uploadfiles/<?echo $theme_folder?>/<? echo $term['icon'] ?>" width="100"/>
                <a   class="delete-button" href="term-delete-img.php?nid=<?php echo $trans_nid ?>&&img=icon">
                    <i class="layui-icon">&#x1007;</i>
                </a>
            </div>


            <h6 >ICON图片</h6>
            <br class="clearfloat" />


            <div class="upload-function">
                <div>
                    <span class="choose-btn layui-btn"/>上传图片</button>
                </div>
                <span class="title-data">(请上传像素<? echo $first_icon_data[0]?>X<? echo $first_icon_data[1]?>的图片,格式为jpeg)</span>
            </div>
        </li>



    </div>

    <script type="jscript">
        layui.use(['upload', 'element', 'layer'], function(){
  var $ = layui.jquery
  ,upload = layui.upload
  ,element = layui.element
  ,layer = layui.layer;

  //常规使用 - 普通图片上传
  var uploadInst = upload.render({
    elem: '#test1'
    ,url: 'https://httpbin.org/post' //此处用的是第三方的 http 请求演示，实际使用时改成您自己的上传接口即可。
    ,before: function(obj){
      //预读本地文件示例，不支持ie8
      obj.preview(function(index, file, result){
        $('#demo1').attr('src', result); //图片链接（base64）
      });

      element.progress('demo', '0%'); //进度条复位
      layer.msg('上传中', {icon: 16, time: 0});
    }
    ,done: function(res){
      //如果上传失败
      if(res.code > 0){
        return layer.msg('上传失败');
      }
      //上传成功的一些操作
      //……
      $('#demoText').html(''); //置空上传失败的状态
    }
    ,error: function(){
      //演示失败状态，并实现重传
      var demoText = $('#demoText');
      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
      demoText.find('.demo-reload').on('click', function(){
        uploadInst.upload();
      });
    }
    //进度条
    ,progress: function(n, elem, e){
      element.progress('demo', n + '%'); //可配合 layui 进度条元素使用
      if(n == 100){
        layer.msg('上传完毕', {icon: 1});
      }
    }
  });
    </script>


